import request from '@/utils/request'

// 查询字段翻译映射列表
export function listTranslation(query) {
  return request({
    url: '/basic/field/translation/list',
    method: 'get',
    params: query
  })
}

// 查询字段翻译映射详细
export function getTranslation(id) {
  return request({
    url: '/basic/field/translation/' + id,
    method: 'get'
  })
}

// 新增字段翻译映射
export function addTranslation(data) {
  return request({
    url: '/basic/field/translation',
    method: 'post',
    data: data
  })
}

// 修改字段翻译映射
export function updateTranslation(data) {
  return request({
    url: '/basic/field/translation',
    method: 'put',
    data: data
  })
}

// 删除字段翻译映射
export function delTranslation(id) {
  return request({
    url: '/basic/field/translation/' + id,
    method: 'delete'
  })
}

// 查询字段表信息以及表的字段信息
export function getTableInfo(tableName) {
  return request({
    url: '/basic/field/translation/table/' + tableName,
    method: 'get'
  })
}

// 导入表字段信息
export function importTable(data) {
  return request({
    url: '/basic/field/translation/import' ,
    method: 'post',
    data: data
  })
}
